
package com.xb.loan.usercenter.service.user;


import com.xb.loan.log.exception.BizException;
import com.xb.loan.usercenter.service.user.bean.*;
import com.xb.loan.usercenter.service.user.bean.*;

import java.util.Date;
import java.util.List;


public interface IUserService {

	/**
	 * 生成用户
	 * @param userInfoVO
	 * @return
	 * @throws BizException
	 */
	public String generateUser(UserInfoVO userInfoVO, int partnerLevel) throws BizException;

	/**
	 * 用户非实名注册
	 * @param userType
	 * @param partnerId
	 * @param loginName
	 * @param pwd
	 * @return userId
	 * @throws BizException
	 */
	public LoginInfoVO registerUser(int userType,
                                    String partnerId, String loginName, String pwd) throws BizException;

	/**
	 * 即开用户非实名注册
	 * @param userType
	 * @param partnerId
	 * @param loginName
	 * @param pwd
	 * @return userId
	 * @throws BizException
	 */
	public WinstantLoginInfoVO registerWinstantUser(int userType,
                                                    String partnerId, String loginName, String pwd) throws BizException;
	/**
	 * 修改手机号
	 * @param userId
	 * @param phone
	 * @return
	 * @throws BizException
	 */
	public int updatePhone(String userId, String phone) throws BizException;

	public int updateLoginName(String userId, String loginName) throws BizException;

	public int updateRealId(String userId, String realId) throws BizException;

	public int updateRealIdNickName(String userId, String nickName, String realId) throws BizException;

	public int updatePwd(String userId, String pwd) throws BizException;

	/**
	 * 更新支付密码
	 * @param userId
	 * @param payPwd
	 * @return
	 * @throws BizException
	 */
	public int updatePayPwd(String userId, String payPwd) throws BizException;

	/**
	 * 用户登录时更新用户最后登录时间和更新用户Token
	 * @param userId		用户编码
	 * @param lastLoginTime	用户时间
	 * @param token			生成用户Token
	 * @param effDate		Token失效时间
	 * @return
	 * @throws BizException
	 */
	public int updateLastLoginTime(String userId, Date lastLoginTime,String token,Date effDate) throws BizException;

	public int updatePhoneLoginName(String userId, String phone) throws BizException;

	/**
	 * 通过用户编码查询用户信息
	 * @param userId		用户编码
	 * @return		返回用户信息VO
	 */
	public UserInfoVO queryUserInfoById(String userId) throws BizException;

	public UserInfoVO queryAnyUserInfoById(String userId) throws BizException;
	/**
	 * 通过实名编码查询用户信息
	 * @param userType
	 * @param realId
	 * @return
	 * @throws BizException
	 */
	public List<UserInfoVO> queryUserInfoByRealId(Integer userType, String realId) throws BizException;

	/**
	 * 验证登录名是否存在，对于o2o来说就是验证手机号是否存在
	 * @param userType (o2o固定为10)
	 * @param loginName (o2o为手机号)
	 * @return
	 * @throws BizException
	 */
	public UserInfoVO queryUserInfoByUserType(int userType, String loginName) throws BizException;

	/**
	 * 按手机号来查询登录用户
	 * @param userType
	 * @param phone
	 * @return
	 * @throws BizException
	 */
	public UserInfoVO queryUserInfoByPhone(int userType, String phone) throws BizException;

	public List<UserInfoVO> queryUserInfo(String loginName, String partnerId, String phone, String startTime,
                                          String endTime, int pageNum, int numPerPage) throws BizException;

	public int queryUserInfoCount(String loginName, String partnerId, String phone,
                                  String startTime, String endTime) throws BizException;

    /**
     * 查询渠道下日，累计注册用户数
     */
    public RegisterUserVO statRegisterUser(String partnerId);

    public int updateUserInfoObj(UserInfoVO userInfoVO);

    public void freezeUser(String userId) throws BizException;

    public void unFreezeUser(String userId) throws BizException;

	/**
	 * 用户注销
	 * @param userId		用户编码
	 * @return				返回注销成功的条数
	 */
	public int logoff(String userId) throws BizException;

	/**
	 * 查询用户基本信息，实名信息，银行卡信息
	 */
	public List<UserInfoIdentifyBankVO> queryUserInfoIdentifyBank(Integer userType, String startTime,
                                                                  String endTime, int pageNum, int numPerPage);

	/**
	 * 查询用户基本信息，实名信息，银行卡信息记录条数
	 */
	public int queryUserInfoIdentifyBankCount(Integer userType, String startTime, String endTime);

	/**
	 * 查询用户基本信息，实名信息
	 */
	public List<UserInfoIdentifyVO> queryUserInfoIdentify(Integer userType, String startTime,
                                                          String endTime, int pageNum, int numPerPage);

	/**
	 * 查询用户基本信息，实名信息记录条数
	 */
	public int queryUserInfoIdentifyCount(Integer userType, String startTime, String endTime);


	public UserInfoVO queryUserInfoByToken(String token) throws BizException;

}
